﻿'***********************************************************************
' Assembly         : SOFA.Caching
' Copyright        : (c) Jebarson. All rights reserved.
' Website			: http://www.jebarson.info
'***********************************************************************

Imports SOFA.Caching.Test

''' <summary>
''' Code behind for the app testing.
''' </summary>
Class TestBed

    ''' <summary>
    ''' Member variable for the country lookup list.
    ''' </summary>
    Dim sourceValue As CountryLookupList

    ''' <summary>
    ''' Handles the Click event of the Load control.
    ''' </summary>
    ''' <param name="sender">The source of the event.</param>
    ''' <param name="e">The <see cref="System.Windows.RoutedEventArgs" /> instance containing the event data.</param>
    Private Sub Load_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Load.Click
        Try
            If (sourceValue Is Nothing) Then
                sourceValue = New CountryLookupList()
            End If

            With Me.CheckBoxList
                .ItemsSource = sourceValue
            End With
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
    End Sub

    ''' <summary>
    ''' Handles the Click event of the LoadAgain control.
    ''' </summary>
    ''' <param name="sender">The source of the event.</param>
    ''' <param name="e">The <see cref="System.Windows.RoutedEventArgs" /> instance containing the event data.</param>
    Private Sub LoadAgain_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles LoadAgain.Click
        Dim source As CountryLookupList

        Try
            source = New CountryLookupList()
            With Me.CheckBoxList
                .ItemsSource = source
            End With
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
    End Sub

    ''' <summary>
    ''' Handles the Click event of the Refresh control.
    ''' </summary>
    ''' <param name="sender">The source of the event.</param>
    ''' <param name="e">The <see cref="System.Windows.RoutedEventArgs" /> instance containing the event data.</param>
    Private Sub Refresh_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Refresh.Click
        Dim source As CountryLookupList

        Try
            source = New CountryLookupList()
            With Me.CheckBoxList
                .ItemsSource = source
            End With
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try
    End Sub
End Class
